while True:

    while True:
        num1 = input("请输入第一个数字：")
        if not num1.isdigit():
            continue
        else:
            num1 = float(num1)
            break

    while True:
        opt1 = input("请输入操作符(+ - * /)：")
        if opt1 in ('+', '-', '*', '/'):
            break
        else:
            continue

    while True:
        num2 = input("请输入第二个数字：")
        if not num2.isdigit():
            continue
        else:
            num2 = float(num2)
            break

    if opt1 == '+':
        res1 = num1 + num2
    elif opt1 == '-':
        res1 = num1 - num2
    elif opt1 == '*':
        res1 = num1 * num2
    elif opt1 == '/':
        res1 = num1 / num2
    else:
        res1 = "无效运算"
    print("计算结果为: {:.2f}".format(res1))

    endorder = input("输入exit退出程序，其它任意键继续计算: ")
    if endorder == 'exit':
        break
    else:
        continue
